@extends('layouts.admin')
@section('css')
    <link href="{{asset('vendors/dataTables/datatables.min.css')}}" rel="stylesheet">
@endsection
@section('content')
    <div class="row wrapper border-bottom white-bg page-heading">
        <div class="col-lg-10">
            <h2>{{$activity->name}}</h2>
            <ol class="breadcrumb">
                <li>
                    <a href="{{url('admin/dash')}}">{!!trans('admin/breadcrumb.home')!!}</a>
                </li>
                <li>
                    <a href="{{url('admin/eticket/activity')}}">{!!trans('admin/breadcrumb.ticket.list')!!}</a>
                </li>
                <li class="active">
                    <strong><i class="fa fa-user"></i> 核销人员</strong>
                </li>
            </ol>
        </div>
    </div>
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>核销人员</h5>
                        <div class="ibox-tools">
                            <button id="add-tickets-btn" data-toggle="modal" data-target="#writeOff-qrcode-modal"
                                    class="btn btn-sm btn-info"><i class="fa fa-plus"></i> 添加核销人员
                            </button>
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        @include('flash::message')
                        <div class="form-inline setting">
                            <div class="form-group">
                                <label for="writeOff-max">核销最大人数：</label>
                                <input id="writeOff-max" type="number" class="form-control writeOff-max" value="{{$writeOff['max']}}">
                            </div>
                        </div>
                        <br>
                        <div class="table-responsive">
                            <table class="table table-striped table-bordered table-hover dataTablesAjax">
                                <thead>
                                <tr>
                                    <th>微信ID</th>
                                    <th>核销情况</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- QRCode Modal -->
    <div class="modal fade qrcode-modal" id="writeOff-qrcode-modal" tabindex="-1" role="dialog"
         aria-labelledby="writeOff-qrcode-modal">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">增加核销人员二维码</h4>
                </div>
                <div class="modal-body" style="text-align: center">
                    <div><img class="qrcode-img" src="{{$writeOff['qrcode']}}" alt=""></div>
                </div>
            </div>
        </div>
    </div>
@endsection
@section('js')
    <script src="{{asset('vendors/dataTables/datatables.min.js')}}"></script>
    <script src="{{asset('vendors/layer/layer.js')}}"></script>
    <script src="{{asset('admin/js/eticket/writeOff.js')}}"></script>
    <script type="text/javascript">
        $(document).on('click', '.destroy_item', function () {
            var _item = $(this);
            var title = "{{trans('admin/alert.deleteTitle')}}";
            layer.confirm(title, {
                btn: ['{{trans('admin/action.actionButton.destroy')}}', '{{trans('admin/action.actionButton.no')}}'],
                icon: 5
            }, function (index) {
                _item.children('form').submit();
                layer.close(index);
            });
        });
    </script>
@endsection